<div class="box-body">
    <form class="layui-form" action="{:url('/system/exchange/save')}" method="post" style="width:550px; height: 350px;">
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">源币种</label>
            <div class="layui-input-block">
                <select name="source_code" lay-search>
                    <option value="">请选择</option>
                    {foreach $currency as $c}
                    <option {if isset($exchange) && $exchange.source_code==$c.currency_code}selected{/if} value="{$c.currency_code}">{$c.currency_name}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">兑换币种</label>
            <div class="layui-input-block">
                <select name="target_code" lay-search>
                    <option value="">请选择</option>
                    {foreach $currency as $c}
                    <option {if isset($exchange) && $exchange.target_code==$c.currency_code}selected{/if} value="{$c.currency_code}">{$c.currency_name}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">兑换比例</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="兑换比例"  name="rate" {if isset($exchange)}value="{$exchange.rate}"{/if} class="layui-input" />
            </div>
        </div>
        {if isset($exchange)}
        <input type="hidden" name="exchange_id" value="{$exchange.exchange_id}">
        {/if}
    </form>
</div>